package com.bienvenue.main.ui.activity.personal;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.bienvenue.main.R;
import com.bienvenue.main.adapter.CollectionsAdapter;
import com.bienvenue.main.base.BaseActivity;
import com.bienvenue.main.model.CollectionsBean;
import com.chad.library.adapter.base.BaseQuickAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * @ProjectName: Bienvenue
 * @Package: com.bienvenue.main.ui.activity
 * @ClassName: CollectionsActivity
 * @Description: 收藏夹
 * @Author: Mr.Chen
 * @CreateDate: 2020/9/15 9:48
 * @UpdateUser: Mr.Chen
 * @UpdateDate: 2020/9/15 9:48
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */


public class CollectionsActivity extends BaseActivity {
    @BindView(R.id.rv_collections_list)
    RecyclerView rvCollectionsList;

    CollectionsAdapter mAdapter;
    @Override
    protected void initData() {

        List<CollectionsBean> list=new ArrayList<>();
        CollectionsBean bean=new CollectionsBean();
        bean.setAddress("陕西 西安 未央");
        bean.setDate("9月12日 14:34");
        bean.setEducation("经验不限 大专");
        bean.setPositionMoney("￥10~15K");
        bean.setPositionType("软件开发");
        bean.setPromptName("西安陇朝盈科技责任有限公司");
        CollectionsBean bean1=new CollectionsBean();
        bean1.setAddress("陕西 西安 雁塔");
        bean1.setDate("9月13日 14:34");
        bean1.setEducation("经验不限 本科");
        bean1.setPositionMoney("￥10~15K");
        bean1.setPositionType("软件开发");
        bean1.setPromptName("西安陇朝盈科技责任有限公司");
        list.add(bean);
        list.add(bean1);
        mAdapter.setNewData(list);

        mAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
            @Override
            public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
                switch (view.getId()){
                    case R.id.cl_item_click:
                        showToast("跳转职位详情");
                        break;
                    case R.id.iv_delete:
                        showToast("跳转到删除");
                        break;
                }
            }
        });



    }

    @Override
    protected void initView() {
        rvCollectionsList.setLayoutManager(new LinearLayoutManager(this));
        mAdapter=new CollectionsAdapter();
        rvCollectionsList.setAdapter(mAdapter);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_collections;
    }
    @OnClick(R.id.iv_return_btn)
    void onFinish(){
        this.finish();
    }
}
